package com.cavy.platform.server.dto;

import lombok.Data;

import java.util.Objects;

@Data
public class JobSubscribeKey {
    private String workSpace;
    private String project;
    private String pipeline;
    private String number;

    public JobSubscribeKey() {
    }

    public JobSubscribeKey(String workSpace, String project, String pipeline, String number) {
        this.workSpace = workSpace;
        this.project = project;
        this.pipeline = pipeline;
        this.number = number;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JobSubscribeKey that = (JobSubscribeKey) o;
        return Objects.equals(workSpace, that.workSpace) &&
                Objects.equals(project, that.project) &&
                Objects.equals(pipeline, that.pipeline) &&
                Objects.equals(number, that.number);
    }

    @Override
    public int hashCode() {
        return Objects.hash(workSpace, project, pipeline, number);
    }
}
